<% layout('/layouts/default.html', {title: '网络信息管理', libs: ['dataGrid']}){ %>
<div class="main-content">
	<div class="box box-main">
		<div class="box-header">
			<div class="box-title">
				<i class="fa icon-notebook"></i> ${text('网络信息管理')}
			</div>
			<div class="box-tools pull-right">
				<a href="#" class="btn btn-default" id="btnSearch" title="${text('查询')}"><i class="fa fa-filter"></i> ${text('查询')}</a>
				<% if(hasPermi('rt:rtDeviceLine:edit')){ %>
					<a href="${ctx}/rt/rtDeviceLine/form" class="btn btn-default btnTool" title="${text('新增网络信息')}"><i class="fa fa-plus"></i> ${text('新增')}</a>
				<% } %>
				<a href="#" class="btn btn-default" id="btnSetting" title="${text('设置')}"><i class="fa fa-navicon"></i></a>
			</div>
		</div>
		<div class="box-body">
			<#form:form id="searchForm" model="${rtDeviceLine}" action="${ctx}/rt/rtDeviceLine/listData" method="post" class="form-inline hide"
					data-page-no="${parameter.pageNo}" data-page-size="${parameter.pageSize}" data-order-by="${parameter.orderBy}">
				<div class="form-group">
					<label class="control-label">${text('设备ID')}：</label>
					<div class="control-inline">
						<#form:input path="deviceId" maxlength="50" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('NET类型')}：</label>
					<div class="control-inline">
						<#form:radio path="netType" dictType="rt_net_type" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('网关')}：</label>
					<div class="control-inline">
						<#form:input path="gateway" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('内网IP')}：</label>
					<div class="control-inline">
						<#form:input path="localIp" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('外网IP')}：</label>
					<div class="control-inline">
						<#form:input path="publicIp" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('运营商')}：</label>
					<div class="control-inline">
						<#form:radio path="ispCode" dictType="rt_isp_code" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('MAC地址')}：</label>
					<div class="control-inline">
						<#form:input path="mac" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('NAT类型')}：</label>
					<div class="control-inline">
						<#form:input path="nat" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('upnpip')}：</label>
					<div class="control-inline">
						<#form:input path="upnpIp" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('upnp网关')}：</label>
					<div class="control-inline">
						<#form:input path="upnpGateway" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('丢包率')}：</label>
					<div class="control-inline">
						<#form:input path="pingLoss" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('延迟')}：</label>
					<div class="control-inline">
						<#form:input path="pingRtt" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('IPV6地址')}：</label>
					<div class="control-inline">
						<#form:input path="ipv6" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('是否是ipv6')}：</label>
					<div class="control-inline">
						<#form:radio path="isIpv6" dictType="rt_is_ipv6" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('是否在线')}：</label>
					<div class="control-inline width-120">
						<#form:select path="online" dictType="rt_online_code" blankOption="true" class="form-control"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('省份-城市')}：</label>
					<div class="control-inline">
						<#form:input path="provinceCity" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('更新时间')}：</label>
					<div class="control-inline">
						<#form:input path="updateTime" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<label class="control-label">${text('测试宽带')}：</label>
					<div class="control-inline">
						<#form:input path="speed" maxlength="255" class="form-control width-120"/>
					</div>
				</div>
				<div class="form-group">
					<button type="submit" class="btn btn-primary btn-sm">${text('查询')}</button>
					<button type="reset" class="btn btn-default btn-sm isQuick">${text('重置')}</button>
				</div>
			</#form:form>
			<table id="dataGrid"></table>
			<div id="dataGridPage"></div>
		</div>
	</div>
</div>
<% } %>
<script>
// 初始化DataGrid对象
$('#dataGrid').dataGrid({
	searchForm: $("#searchForm"),
	columnModel: [
		{header:'${text("设备ID")}', name:'deviceId', index:'a.device_id', width:150, align:"left", frozen:true, formatter: function(val, obj, row, act){
			return '<a href="${ctx}/rt/rtDeviceLine/form?id='+row.id+'" class="btnList" data-title="${text("编辑网络信息")}">'+(val||row.id)+'</a>';
		}},
		{header:'${text("NET类型")}', name:'netType', index:'a.net_type', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('rt_net_type')}, val, '${text("未知")}', true);
		}},
		{header:'${text("网关")}', name:'gateway', index:'a.gateway', width:150, align:"left"},
		{header:'${text("内网IP")}', name:'localIp', index:'a.local_ip', width:150, align:"left"},
		{header:'${text("外网IP")}', name:'publicIp', index:'a.public_ip', width:150, align:"left"},
		{header:'${text("运营商")}', name:'ispCode', index:'a.isp_code', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('rt_isp_code')}, val, '${text("未知")}', true);
		}},
		{header:'${text("MAC地址")}', name:'mac', index:'a.mac', width:150, align:"left"},
		{header:'${text("NAT类型")}', name:'nat', index:'a.nat', width:150, align:"left"},
		{header:'${text("upnpip")}', name:'upnpIp', index:'a.upnp_ip', width:150, align:"left"},
		{header:'${text("upnp网关")}', name:'upnpGateway', index:'a.upnp_gateway', width:150, align:"left"},
		{header:'${text("丢包率")}', name:'pingLoss', index:'a.ping_loss', width:150, align:"left"},
		{header:'${text("延迟")}', name:'pingRtt', index:'a.ping_rtt', width:150, align:"left"},
		{header:'${text("IPV6地址")}', name:'ipv6', index:'a.ipv6', width:150, align:"left"},
		{header:'${text("是否是ipv6")}', name:'isIpv6', index:'a.is_ipv6', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('rt_is_ipv6')}, val, '${text("未知")}', true);
		}},
		{header:'${text("是否在线")}', name:'online', index:'a.online', width:150, align:"center", formatter: function(val, obj, row, act){
			return js.getDictLabel(${@DictUtils.getDictListJson('rt_online_code')}, val, '${text("未知")}', true);
		}},
		{header:'${text("省份-城市")}', name:'provinceCity', index:'a.province_city', width:150, align:"left"},
		{header:'${text("更新时间")}', name:'updateTime', index:'a.update_time', width:150, align:"left"},
		{header:'${text("测试宽带")}', name:'speed', index:'a.speed', width:150, align:"left"},
		{header:'${text("操作")}', name:'actions', width:120, formatter: function(val, obj, row, act){
			var actions = [];
			//<% if(hasPermi('rt:rtDeviceLine:edit')){ %>
				actions.push('<a href="${ctx}/rt/rtDeviceLine/form?id='+row.id+'" class="btnList" title="${text("编辑网络信息")}"><i class="fa fa-pencil"></i></a>&nbsp;');
				actions.push('<a href="${ctx}/rt/rtDeviceLine/delete?id='+row.id+'" class="btnList" title="${text("删除网络信息")}" data-confirm="${text("确认要删除该网络信息吗？")}"><i class="fa fa-trash-o"></i></a>&nbsp;');
			//<% } %>
			return actions.join('');
		}}
	],
	// 加载成功后执行事件
	ajaxSuccess: function(data){
		
	}
});
</script>